package com.lc.luzhengtang.fragment;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lc.luzhengtang.R;
import com.lc.luzhengtang.adapter.WaitingFragmentAdapter;
import com.lc.luzhengtang.divider.SimpleDividerItemDecoration;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/5/3.
 */

public class PendingFragment extends BaseFragment {

    Unbinder unbinder;
    List<String> urls;



    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;


    List<String> mDatas;

    WaitingFragmentAdapter mIndexAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //  return super.onCreateView(inflater, container, savedInstanceState);
        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_waitting, null);

        unbinder = ButterKnife.bind(this, view);


        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        mDatas = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            mDatas.add("屌人" + i);
        }
        mIndexAdapter = new WaitingFragmentAdapter(mDatas);
        Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.line_divider_index);
        recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getContext(), drawable, 2));
        recyclerView.setAdapter(mIndexAdapter);
        recyclerView.setNestedScrollingEnabled(false);
        return view;
    }

}
